﻿Imports System

Namespace System.Workflow.ComponentModel
    Friend NotInheritable Class ActivityResolveEventArgs
        Inherits EventArgs
        ' Methods
        Friend Sub New(ByVal activityType As Type, ByVal workflowMarkup As String, ByVal rulesMarkup As String, ByVal createNew As Boolean, ByVal initForRuntime As Boolean, ByVal serviceProvider As IServiceProvider)
            If Not (String.IsNullOrEmpty(workflowMarkup) Xor (activityType Is Nothing)) Then
                Throw New ArgumentException(SR.GetString("Error_WrongParamForActivityResolveEventArgs"))
            End If
            Me.activityType = activityType
            Me.activityDefinition = workflowMarkup
            Me.rulesDefinition = rulesMarkup
            Me.createNew = createNew
            Me.initForRuntime = initForRuntime
            Me.serviceProvider = serviceProvider
        End Sub


        ' Properties
        Public ReadOnly Property CreateNewDefinition As Boolean
            Get
                Return Me.createNew
            End Get
        End Property

        Public ReadOnly Property InitializeForRuntime As Boolean
            Get
                Return Me.initForRuntime
            End Get
        End Property

        Public ReadOnly Property RulesMarkup As String
            Get
                Return Me.rulesDefinition
            End Get
        End Property

        Public ReadOnly Property ServiceProvider As IServiceProvider
            Get
                Return Me.serviceProvider
            End Get
        End Property

        Public ReadOnly Property Type As Type
            Get
                Return Me.activityType
            End Get
        End Property

        Public ReadOnly Property WorkflowMarkup As String
            Get
                Return Me.activityDefinition
            End Get
        End Property


        ' Fields
        Private activityDefinition As String
        Private activityType As Type
        Private createNew As Boolean
        Private initForRuntime As Boolean = True
        Private rulesDefinition As String
        Private serviceProvider As IServiceProvider
    End Class
End Namespace

